package com.example.rabbit.producer;

import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.messaging.support.GenericMessage;

@SpringBootTest
public class RabbitProducerApplicationTest {

    @Resource
    private StreamBridge streamBridge;

    @Test
    void contextLoads() {
        streamBridge.send("output", new GenericMessage<>("Hello, world!"));
    }

}

// 关于 Binder 测试，可以参考 Spring Cloud Stream 的官方文档： https://docs.spring.io/spring-cloud-stream/reference/spring-cloud-stream/spring_integration_test_binder.html